/**
 * 
 */

var interval;
var cnt = 0;
var week = ['일', '월', '화', '수', '목', '금', '토'];

function IntervalInit() {
	document.getElementById("btnStart").onclick = startFunc;
	document.getElementById("btnStop").onclick = stopFunc;
} 

function startFunc() {
	interval = setInterval(clock, 1000);
	alert("start!");
}	

function stopFunc(){
	clearInterval(interval)
	alert("stop!");
}

function clock(){
	// cnt++;
	var now = new Date();
	cnt = now.getFullYear() + "년";
	cnt += (now.getMonth()+1) + "월";
	cnt += now.getDate() + "일(";
	cnt += week[now.getDay()] + "요일)<br/>";
	
	cnt += now.getHours() + " : ";
	cnt += now.getMinutes() + " : ";
	cnt += now.getSeconds();
	
	var r = document.getElementById('result');
	r.innerHTML = cnt;
}